<h3 class="title"> <span>修改密码</span> </h3>
<div class="profile_password">
    <form class="form-inline" role="form" id="resetpassword" action="<!--{iCMS:router url='/user'}-->" method="post" target="iCMS_FRAME">
      <input name="action" type="hidden" value="profile" />
      <input name="pg" type="hidden" value="setpassword" />
      <dl>
        <dt>现在的密码：</dt>
        <dd>
          <input name="oldPwd" class="form-control" type="password" value="">
        </dd>
        <dt>新的密码：</dt>
        <dd>
          <input id="password" name="newPwd1" class="form-control" type="password" data-errormsg="密码长度应为6~16个字符">
          <span class="help-block">密码长度应为6~16个字符</span>
        </dd>
        <dt>确认新的密码：</dt>
        <dd>
          <input name="newPwd2" class="form-control" type="password" value="">
        </dd>
        <dd>
            <input type="text" placeholder="验证码" maxlength="4" name="seccode" id="iCMS-reg-seccode" class="iCMS_seccode form-control">
            <img src="<!--{iCMS:router url='/api/public/seccode'}-->" alt="验证码" class="iCMS_seccode_img r3"/>
            <a href="javascript:;" class="iCMS_seccode_text" style="float: none">换一张</a>
            <span class="help-block seccode_tip">请输入图片中的字符!</span>
        </dd>
        <dd>
          <button class="btn btn-primary btn-lg btn-block" type="submit" data-loading-text='<i class="fa fa-spinner"></i> 提交中...'><i class="fa fa-check"></i> 确认修改</button>
        </dd>
      </dl>
    </form>
  </div>
<script type="text/javascript">
$(function(){
	$("#resetpassword").submit(function(){
		var oldPwd= $("[name='oldPwd']");
		if(oldPwd.val()==""){
      oldPwd.focus();
			iCMS.alert("请填写原密码！");
			return false;
		}
		var password= $("#password").val();
		if(password==""){
      $("#password").focus();
			iCMS.alert("请填写新密码！");
			return false;
		}
		if(password.length<6){
      $("#password").focus();
			iCMS.alert("新密码太短啦，至少要6位哦");
			return false;
		}
		var newPwd2= $("[name='newPwd2']");
		if(newPwd2.val()==""){
      newPwd2.focus();
			iCMS.alert("请确认新的密码！");
			return false;
		}
		if(password!=newPwd2.val()){
      $("#password").focus();
			iCMS.alert("新的密码与确认密码不一致！");
			return false;
		}
		var seccode= $("[name='seccode']");
		if(seccode.val()==""){
      seccode.focus();
			iCMS.alert("请输入验证码！");
			return false;
		}
    $(".btn-block").button('loading');
	})
})
</script>

